package com.base.study.activity;

import android.support.v4.app.FragmentTransaction;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.base.commonlib.base.CBaseBarMvpActivity;
import com.base.study.R;
import com.base.study.databinding.ActivityStudyBinding;
import com.base.study.fragment.StudyDoubleListFragment;
import com.base.study.presenter.StudyPresenter;
import com.base.study.view.StudyView;

/**
 * Created by weikailiang on 2020/4/9.
 */
@Route(path = "/subject/study")
public class StudyActivity extends CBaseBarMvpActivity<StudyPresenter> implements StudyView{

    private ActivityStudyBinding mBinding;
    @Override
    protected int getLayoutResource() {
        return R.layout.activity_study;
    }

    @Override
    protected void init() {
        super.init();
        mBinding = (ActivityStudyBinding) mRootBinding;
        mPresenter = new StudyPresenter(this,this);
        mPresenter.start();
        setBackNavigation();
        setBarTitle("在线学习");
    }

    @Override
    protected void start() {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add(R.id.contain, new StudyDoubleListFragment(), StudyDoubleListFragment.class.getName());
        transaction.commitAllowingStateLoss();
    }
}
